package top.yuhaitao.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import top.yuhaitao.cloud.entity.User;
import top.yuhaitao.cloud.feign.UserFeignClient;
import top.yuhaitao.cloud.feign.UserFeignClient2;

@RestController
public class MovieController {
	@Autowired
	private UserFeignClient userFeignClient;
	@Autowired
	private UserFeignClient2 userFeignClient2;

	@GetMapping("/getUserById/{id}")
	public User getUserById(@PathVariable Long id) {
		return this.userFeignClient.getUserById(id);
	}

	@GetMapping("/getUserById2/{id}")
	public User getUserById2(@PathVariable Long id) {
		return this.userFeignClient.getUserById2(id);
	}

	@GetMapping("/serviceName/{serviceName}")
	public String findServiceInfoFromEurekaByServiceName(@PathVariable String serviceName) {
		return this.userFeignClient2.findServiceInfoFromEurekaByServiceName(serviceName);
	}

}
